"""Module responsible for image aquisition and preprocessing using ImageProcessing class"""
import freenect
import usb.core
 
def setTiltLevel(level = "low"):
    """Set proper tilt level for Kinect device, default is low"""
    dev = usb.core.find(idVendor = 0x045e, idProduct = 0x02B0)
    if dev is None:
        raise ValueError('Device not found')
    dev.set_configuration()
    if level == "high":
        dev.ctrl_transfer(0x40, 0x31, 0xff24, 0x0, []) # set me higher!
    if level == "low":
        dev.ctrl_transfer(0x40, 0x31, 0xff05, 0x0, [])

def getRGBImageRaw():
    """Get raw colour RGB image from Kinect VGA camera"""
    RGBImage = freenect.sync_get_video()[0]    
    return RGBImage        
         
def getDepthImageRaw():
    """Get raw depth image from Kinect depth sensor"""
    depthImage = freenect.sync_get_depth()[0]
    return depthImage

